﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SGArchiveSystem7xDB.Linq
{
    /// <summary>
    /// 档案模板
    /// </summary>
    public class T_ArchiveFieldsModelDal
    {
        static SGArchiveSystem7xEntities conn;

        /// <summary>
        /// 获取档案模板
        /// </summary>
        /// <returns></returns>
        public static List<T_ArchiveFieldsModel> Get_ArchiveFieldsModel()
        {
            conn = new SGArchiveSystem7xEntities();
            return Get_ArchiveFieldsModel(conn);
        }
        /// <summary>
        /// 获取档案模板，供其他方法调用，无需再次初始化数据库连接
        /// </summary>
        /// <param name="conn"></param>
        /// <returns></returns>
        public static List<T_ArchiveFieldsModel> Get_ArchiveFieldsModel(SGArchiveSystem7xEntities conn)
        {
            try
            {
                return conn.T_ArchiveFieldsModel.Select(c => c).OrderBy(c => c.AF_ID).ToList();
            }
            catch { return null; }
        }
    }
}
